<template>
	<view>
		<view class="grace-loading" v-if="isLoadAll">{{ loadingTxt }}</view>
		<ul v-for="(item,index) in salesOrderList">
			<li>{{item.education}}{{index}}</li>

		</ul>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				totalPages: 1, // 总页数
				loadingTxt: '加载中...',
				isLoadAll: false,
				paramsData: {
					pageNum: 1,
					pageSize: 10,
				},
				searchForm: {
					currentPage: 1,
					pageSize: 10,
					type: "jbfull",
					search: '',
					userId: 'oMuiX5j2oNm0IgslPovpHC8Ej_Ko'
				},
				salesOrderList: [] // list数组
			}
		},
		created() {
			this._orderRecord()
		},
		methods: {
			_orderRecord() {

				this.$myResquest.getRecruitSearch(this.searchForm).then(res => {
					if(res.data.code==200){
						setTimeout(()=>{
							uni.hideLoading()
						},500)
						this.totalPages = res.data.pageCount
						this.salesOrderList = [...this.salesOrderList, ...res.data.data];
					}
				});
			},
		},
		/* 上拉加载 */
	
	// uni-app页面滚动到底部的事件，常用于上滑加载下一页数据
	onReachBottom() {
	    // 判断当前页是否大于等于总页数
	    if (this.totalPages <= this.searchForm.currentPage) {
	        this.isLoadAll = true;
		this.loadingTxt = '没有更多数据啦~';
	    } else {
		this.searchForm.currentPage++;
		this.isLoadAll = true;
		setTimeout(()=>{
			uni.showLoading({
				title:'加载中'
			})
		},500)
		this._orderRecord();   // 每次滑动请求接口，实现上拉加载更多数据
	    }
	},
	}
</script>

<style scoped>

</style>
